﻿using System;
using System.Windows;

namespace AEM
{
    public static class Program
    {
        public static void ErrCallback(string message, string title, bool isNeedCloseApp, Exception exception)
        {
            if (!isNeedCloseApp) return;
            if (string.IsNullOrEmpty(title)) title = "发生严重的错误,是否重试？(是：重试；否：中止；取消：忽略。)";
            MessageBoxResult dr = MessageBox.Show(message, title, MessageBoxButton.YesNoCancel, MessageBoxImage.Error, MessageBoxResult.No);
            if (dr == MessageBoxResult.No) Environment.Exit(-9);
            else if (dr == MessageBoxResult.Yes) { }
            else if (dr == MessageBoxResult.Cancel) { }

        }
    }
}
